public class cls_CreateTestRecords {
    
    public static Account createAccount(){
        Account acc = new Account(Name='Test');
        insert acc;
        return acc;
    }
    
    public static Country__c createCountries() {
        Country__c Countries = new Country__c();
        Countries.Name = 'Egyptian';
        Countries.eFormCode__c = 'Test';
        Countries.IsActive__c = true;
        insert Countries;
        return countries;
    }
    
    public static CountriesList__c createCountriesList(){
        CountriesList__c CountriesList = new CountriesList__c();
        CountriesList.Name = 'Egypt';
        CountriesList.IsActive__c = true;
        CountriesList.eFormCode__c = 'Test';
        insert CountriesList;
        return CountriesList;
    }
    
    
    public static Occupation__c createOccupation() {
        Occupation__c OCP = new Occupation__c();
        OCP.Name = 'ADMINISTARTIVE ASSISTANT';
        OCP.IsActive__c = true;
        OCP.eFormCode__c = 'Test';
        insert OCP;
        return OCP;
    } 
    
    public static Qualification__c createQualiciation() {
        Qualification__c QualificationsList = new Qualification__c();
        QualificationsList.Name = 'B.A. GEOGRAPHY';
        QualificationsList.IsActive__c = true;
        QualificationsList.eFormCode__c = 'Test';
        insert QualificationsList;
        return QualificationsList;
    }
    
    public static Passport_Type__c createPassportType() {
        Passport_Type__c pt = new Passport_Type__c();
        pt.Name = 'Diplomatic';
        pt.IsActive__c = true;
        pt.eFormCode__c = 'Test';
        insert pt;
        return pt;
    }
    

    public static void createFormRecords1() { //Normal Form headers
        //Test data
        
        List<Form_Header__c> formHeaderList = new List<Form_Header__c>();
        Form_Header__c formHeader1 = new Form_Header__c();
        formHeader1.Name = 'DIFC Business Visit Visa Form - Short Term';
        formHeader1.Barcode_Type__c = 'QR';
        formHeaderList.add(formHeader1);
        
        Form_Header__c formHeader2 = new Form_Header__c();
        formHeader2.Name = 'DIFC Business Visit Visa Form';
        formHeader2.Barcode_Type__c = 'QR';
        formHeaderList.add(formHeader2);
        
        Form_Header__c formHeader3 = new Form_Header__c();
        formHeader3.Name = 'SAP3';
        formHeader3.Barcode_Type__c = 'QR';
        formHeaderList.add(formHeader3);
        
        Form_Header__c formHeader4 = new Form_Header__c();
        formHeader4.Name = 'Non DIFC Sponsorship Form - Renewal';
        formHeader4.Barcode_Type__c = 'QR';
        formHeaderList.add(formHeader4);
        
        Form_Header__c formHeader5 = new Form_Header__c();
        formHeader5.Name = 'Non DIFC Sponsorship Form - New - Inside UAE - Visa Stamping';
        formHeader5.Barcode_Type__c = 'QR';
        formHeaderList.add(formHeader5);
        
        Form_Header__c formHeader6 = new Form_Header__c();
        formHeader6.Name = 'Non DIFC Sponsorship Form - New - Outside UAE - Visa Stamping';
        formHeader6.Barcode_Type__c = 'QR';
        formHeaderList.add(formHeader6);
       
        
        
        
        
        
        //If insert the Form Header...
        if(formHeaderList.size() > 0)
            insert formHeaderList;
            
        List<Field_Master__c> fieldMasterList = new List<Field_Master__c>();
        
Field_Master__c masterObject2 = new Field_Master__c();masterObject2.API_Name__c = 'Marital_Status__c';masterObject2.IsActive__c = true;masterObject2.Name = 'Marital Status';masterObject2.Reference_To__c = '()';masterObject2.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject2);
Field_Master__c masterObject3 = new Field_Master__c();masterObject3.API_Name__c = 'VRF_Pre_approval_required__c';masterObject3.IsActive__c = true;masterObject3.Name = 'VRF Pre approval required';masterObject3.Reference_To__c = '()';masterObject3.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject3);
Field_Master__c masterObject4 = new Field_Master__c();masterObject4.API_Name__c = 'Date__c';masterObject4.IsActive__c = true;masterObject4.Name = 'Date';masterObject4.Reference_To__c = '()';masterObject4.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject4);
Field_Master__c masterObject5 = new Field_Master__c();masterObject5.API_Name__c = 'VRF_Available_In__c';masterObject5.IsActive__c = true;masterObject5.Name = 'VRF Available In';masterObject5.Reference_To__c = '()';masterObject5.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject5);
Field_Master__c masterObject6 = new Field_Master__c();masterObject6.API_Name__c = 'DRV_Monthly_Salary__c';masterObject6.IsActive__c = true;masterObject6.Name = 'DRV Monthly Salary';masterObject6.Reference_To__c = '()';masterObject6.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject6);
Field_Master__c masterObject7 = new Field_Master__c();masterObject7.API_Name__c = 'DRV_Sponser_Office_Phone__c';masterObject7.IsActive__c = true;masterObject7.Name = 'DRV Sponser Office Phone';masterObject7.Reference_To__c = '()';masterObject7.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject7);
Field_Master__c masterObject8 = new Field_Master__c();masterObject8.API_Name__c = 'LastModifiedDate';masterObject8.IsActive__c = true;masterObject8.Name = 'Last Modified Date';masterObject8.Reference_To__c = '()';masterObject8.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject8);
Field_Master__c masterObject9 = new Field_Master__c();masterObject9.API_Name__c = 'Id';masterObject9.IsActive__c = true;masterObject9.Name = 'Record ID';masterObject9.Reference_To__c = '()';masterObject9.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject9);
Field_Master__c masterObject10 = new Field_Master__c();masterObject10.API_Name__c = 'Middle_Name__c';masterObject10.IsActive__c = true;masterObject10.Name = 'Middle Name';masterObject10.Reference_To__c = '()';masterObject10.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject10);
Field_Master__c masterObject11 = new Field_Master__c();masterObject11.API_Name__c = 'Health_Card_Expiry_Date__c';masterObject11.IsActive__c = true;masterObject11.Name = 'Health Card Expiry Date';masterObject11.Reference_To__c = '()';masterObject11.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject11);
Field_Master__c masterObject12 = new Field_Master__c();masterObject12.API_Name__c = 'Name';masterObject12.IsActive__c = true;masterObject12.Name = 'Health Card Renewal Name';masterObject12.Reference_To__c = '()';masterObject12.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject12);
Field_Master__c masterObject13 = new Field_Master__c();masterObject13.API_Name__c = 'DRV_Sponser_Residency_Expiry__c';masterObject13.IsActive__c = true;masterObject13.Name = 'DRV Sponser Residency Expiry';masterObject13.Reference_To__c = '()';masterObject13.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject13);
Field_Master__c masterObject14 = new Field_Master__c();masterObject14.API_Name__c = 'VRF_Visa_Type__c';masterObject14.IsActive__c = true;masterObject14.Name = 'VRF Visa Type';masterObject14.Reference_To__c = '()';masterObject14.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject14);
Field_Master__c masterObject15 = new Field_Master__c();masterObject15.API_Name__c = 'Port_of_Entry__c';masterObject15.IsActive__c = true;masterObject15.Name = 'Port of Entry';masterObject15.Reference_To__c = '()';masterObject15.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject15);
Field_Master__c masterObject16 = new Field_Master__c();masterObject16.API_Name__c = 'DRV_Sponser_Visa_Number_2__c';masterObject16.IsActive__c = true;masterObject16.Name = 'DRV Sponser Visa Number 2';masterObject16.Reference_To__c = '()';masterObject16.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject16);
Field_Master__c masterObject17 = new Field_Master__c();masterObject17.API_Name__c = 'DRV_Relation_with_Sponser__c';masterObject17.IsActive__c = true;masterObject17.Name = 'DRV Relation with Sponser';masterObject17.Reference_To__c = '()';masterObject17.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject17);
Field_Master__c masterObject18 = new Field_Master__c();masterObject18.API_Name__c = 'TAMM_VIP_Service__c';masterObject18.IsActive__c = true;masterObject18.Name = 'TAMM VIP Service';masterObject18.Reference_To__c = '()';masterObject18.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject18);
Field_Master__c masterObject19 = new Field_Master__c();masterObject19.API_Name__c = 'DRV_Sponser_Passport_Expiry__c';masterObject19.IsActive__c = true;masterObject19.Name = 'DRV Sponser Passport Expiry';masterObject19.Reference_To__c = '()';masterObject19.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject19);
Field_Master__c masterObject20 = new Field_Master__c();masterObject20.API_Name__c = 'Passport_Country_of_Issue__c';masterObject20.IsActive__c = true;masterObject20.Name = 'Passport Country of Issue';masterObject20.Reference_To__c = '(CountriesList__c)';masterObject20.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject20);
Field_Master__c masterObject21 = new Field_Master__c();masterObject21.API_Name__c = 'Arabic_Name__c';masterObject21.IsActive__c = true;masterObject21.Name = 'Arabic Name';masterObject21.Reference_To__c = '()';masterObject21.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject21);
Field_Master__c masterObject22 = new Field_Master__c();masterObject22.API_Name__c = 'Education_Qualification__c';masterObject22.IsActive__c = true;masterObject22.Name = 'Education Qualification';masterObject22.Reference_To__c = '(Qualification__c)';masterObject22.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject22);
Field_Master__c masterObject23 = new Field_Master__c();masterObject23.API_Name__c = 'DRV_Sponser_Home_Phone__c';masterObject23.IsActive__c = true;masterObject23.Name = 'DRV Sponser Home Phone';masterObject23.Reference_To__c = '()';masterObject23.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject23);
Field_Master__c masterObject24 = new Field_Master__c();masterObject24.API_Name__c = 'VRF_Verify2__c';masterObject24.IsActive__c = true;masterObject24.Name = 'VRF Verify2';masterObject24.Reference_To__c = '()';masterObject24.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject24);
Field_Master__c masterObject25 = new Field_Master__c();masterObject25.API_Name__c = 'Passport_City_of_Issue__c';masterObject25.IsActive__c = true;masterObject25.Name = 'Passport City of Issue';masterObject25.Reference_To__c = '()';masterObject25.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject25);
Field_Master__c masterObject26 = new Field_Master__c();masterObject26.API_Name__c = 'DRV_Sponser_Currently_Nationality__c';masterObject26.IsActive__c = true;masterObject26.Name = 'DRV Sponser Currently Nationality';masterObject26.Reference_To__c = '(Country__c)';masterObject26.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject26);
Field_Master__c masterObject27 = new Field_Master__c();masterObject27.API_Name__c = 'Previous_Nationality__c';masterObject27.IsActive__c = true;masterObject27.Name = 'Previous Nationality';masterObject27.Reference_To__c = '(Country__c)';masterObject27.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject27);
Field_Master__c masterObject28 = new Field_Master__c();masterObject28.API_Name__c = 'Title__c';masterObject28.IsActive__c = true;masterObject28.Name = 'Title';masterObject28.Reference_To__c = '()';masterObject28.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject28);
Field_Master__c masterObject29 = new Field_Master__c();masterObject29.API_Name__c = 'DRV_Sponser_Middle_Name__c';masterObject29.IsActive__c = true;masterObject29.Name = 'DRV Sponser Middle Name';masterObject29.Reference_To__c = '()';masterObject29.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject29);
Field_Master__c masterObject30 = new Field_Master__c();masterObject30.API_Name__c = 'DRV_Sponser_Visa_Number_3__c';masterObject30.IsActive__c = true;masterObject30.Name = 'DRV Sponser Visa Number 3';masterObject30.Reference_To__c = '()';masterObject30.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject30);
Field_Master__c masterObject31 = new Field_Master__c();masterObject31.API_Name__c = 'Religion__c';masterObject31.IsActive__c = true;masterObject31.Name = 'Religion';masterObject31.Reference_To__c = '()';masterObject31.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject31);
Field_Master__c masterObject32 = new Field_Master__c();masterObject32.API_Name__c = 'Visa_Period__c';masterObject32.IsActive__c = true;masterObject32.Name = 'Visa_Period';masterObject32.Reference_To__c = '()';masterObject32.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject32);
Field_Master__c masterObject33 = new Field_Master__c();masterObject33.API_Name__c = 'VRF_Transfer_Flag__c';masterObject33.IsActive__c = true;masterObject33.Name = 'VRF Transfer Flag';masterObject33.Reference_To__c = '()';masterObject33.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject33);
Field_Master__c masterObject34 = new Field_Master__c();masterObject34.API_Name__c = 'Job_Title_Position__c';masterObject34.IsActive__c = true;masterObject34.Name = 'Job Title/Position';masterObject34.Reference_To__c = '(Occupation__c)';masterObject34.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject34);
Field_Master__c masterObject35 = new Field_Master__c();masterObject35.API_Name__c = 'DRV_Sponser_Date__c';masterObject35.IsActive__c = true;masterObject35.Name = 'DRV Sponser Date';masterObject35.Reference_To__c = '()';masterObject35.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject35);
Field_Master__c masterObject36 = new Field_Master__c();masterObject36.API_Name__c = 'Previous_Passport_Number__c';masterObject36.IsActive__c = true;masterObject36.Name = 'Previous Passport Number';masterObject36.Reference_To__c = '()';masterObject36.Referencing_Value__c = '';fieldMasterList.add( masterObject36);
Field_Master__c masterObject37 = new Field_Master__c();masterObject37.API_Name__c = 'Commercial_Activity__c';masterObject37.IsActive__c = true;masterObject37.Name = 'Commercial Activity';masterObject37.Reference_To__c = '()';masterObject37.Referencing_Value__c = '';fieldMasterList.add( masterObject37);
Field_Master__c masterObject38 = new Field_Master__c();masterObject38.API_Name__c = 'Establishment__c';masterObject38.IsActive__c = true;masterObject38.Name = 'Establishment';masterObject38.Reference_To__c = '()';masterObject38.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject38);
Field_Master__c masterObject39 = new Field_Master__c();masterObject39.API_Name__c = 'Sponsor_Department__c';masterObject39.IsActive__c = true;masterObject39.Name = 'Sponsor Department';masterObject39.Reference_To__c = '()';masterObject39.Referencing_Value__c = '';fieldMasterList.add( masterObject39);
Field_Master__c masterObject40 = new Field_Master__c();masterObject40.API_Name__c = 'Sponsor_Gender__c';masterObject40.IsActive__c = true;masterObject40.Name = 'Sponsor Gender';masterObject40.Reference_To__c = '()';masterObject40.Referencing_Value__c = '';fieldMasterList.add( masterObject40);
Field_Master__c masterObject41 = new Field_Master__c();masterObject41.API_Name__c = 'Passport_Type__c';masterObject41.IsActive__c = true;masterObject41.Name = 'Passport Type';masterObject41.Reference_To__c = '(Passport_Type__c)';masterObject41.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject41);
Field_Master__c masterObject42 = new Field_Master__c();masterObject42.API_Name__c = 'Company_Index_Card_Number__c';masterObject42.IsActive__c = true;masterObject42.Name = 'Company Index Card Number';masterObject42.Reference_To__c = '()';masterObject42.Referencing_Value__c = '';fieldMasterList.add( masterObject42);
Field_Master__c masterObject43 = new Field_Master__c();masterObject43.API_Name__c = 'Applicant_Mobile_Number__c';masterObject43.IsActive__c = true;masterObject43.Name = 'Applicant Mobile Number';masterObject43.Reference_To__c = '()';masterObject43.Referencing_Value__c = '';fieldMasterList.add( masterObject43);
Field_Master__c masterObject44 = new Field_Master__c();masterObject44.API_Name__c = 'Company_Point_Of_Contact_Mobile_Number__c';masterObject44.IsActive__c = true;masterObject44.Name = 'Company Point Of Contact Mobile Number';masterObject44.Reference_To__c = '()';masterObject44.Referencing_Value__c = '';fieldMasterList.add( masterObject44);
Field_Master__c masterObject45 = new Field_Master__c();masterObject45.API_Name__c = 'Residencears__c';masterObject45.IsActive__c = true;masterObject45.Name = 'Residency Years';masterObject45.Reference_To__c = '()';masterObject45.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject45);
Field_Master__c masterObject46 = new Field_Master__c();masterObject46.API_Name__c = 'Establishment_Type__c';masterObject46.IsActive__c = true;masterObject46.Name = 'Establishment Type';masterObject46.Reference_To__c = '()';masterObject46.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject46);
Field_Master__c masterObject47 = new Field_Master__c();masterObject47.API_Name__c = 'Establishment_Name1__c';masterObject47.IsActive__c = true;masterObject47.Name = 'Establishment Name';masterObject47.Reference_To__c = '(Account)';masterObject47.Referencing_Value__c = 'Namex';fieldMasterList.add( masterObject47);
Field_Master__c masterObject48 = new Field_Master__c();masterObject48.API_Name__c = 'Main_Only_Person__c';masterObject48.IsActive__c = true;masterObject48.Name = 'Main/Only Person';masterObject48.Reference_To__c = '()';masterObject48.Referencing_Value__c = '';fieldMasterList.add( masterObject48);
Field_Master__c masterObject49 = new Field_Master__c();masterObject49.API_Name__c = 'Country_EDNRD__c';masterObject49.IsActive__c = true;masterObject49.Name = 'Country EDNRD';masterObject49.Reference_To__c = '(CountriesList__c)';masterObject49.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject49);
Field_Master__c masterObject50 = new Field_Master__c();masterObject50.API_Name__c = 'Passport_Issue_Government__c';masterObject50.IsActive__c = true;masterObject50.Name = 'Passport Issue Government';masterObject50.Reference_To__c = '(CountriesList__c)';masterObject50.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject50);
Field_Master__c masterObject51 = new Field_Master__c();masterObject51.API_Name__c = 'Father_Name__c';masterObject51.IsActive__c = true;masterObject51.Name = 'Father Name';masterObject51.Reference_To__c = '()';masterObject51.Referencing_Value__c = '';fieldMasterList.add( masterObject51);
Field_Master__c masterObject52 = new Field_Master__c();masterObject52.API_Name__c = 'Entry_Permit_Work_Visa_Company__c';masterObject52.IsActive__c = true;masterObject52.Name = 'Entry Permit Work Visa-Company';masterObject52.Reference_To__c = '()';masterObject52.Referencing_Value__c = '';fieldMasterList.add( masterObject52);
Field_Master__c masterObject53 = new Field_Master__c();masterObject53.API_Name__c = 'City_EDNRD__c';masterObject53.IsActive__c = true;masterObject53.Name = 'City EDNRD';masterObject53.Reference_To__c = '()';masterObject53.Referencing_Value__c = '';fieldMasterList.add( masterObject53);
Field_Master__c masterObject54 = new Field_Master__c();masterObject54.API_Name__c = 'Job_Title_EDNRD__c';masterObject54.IsActive__c = true;masterObject54.Name = 'Job Title EDNRD';masterObject54.Reference_To__c = '()';masterObject54.Referencing_Value__c = '';fieldMasterList.add( masterObject54);
Field_Master__c masterObject55 = new Field_Master__c();masterObject55.API_Name__c = 'Urgent__c';masterObject55.IsActive__c = true;masterObject55.Name = 'Urgent';masterObject55.Reference_To__c = '()';masterObject55.Referencing_Value__c = '';fieldMasterList.add( masterObject55);
Field_Master__c masterObject56 = new Field_Master__c();masterObject56.API_Name__c = 'Address1__c';masterObject56.IsActive__c = true;masterObject56.Name = 'Address1';masterObject56.Reference_To__c = '()';masterObject56.Referencing_Value__c = '';fieldMasterList.add( masterObject56);
Field_Master__c masterObject57 = new Field_Master__c();masterObject57.API_Name__c = 'Short_Term_Visa__c';masterObject57.IsActive__c = true;masterObject57.Name = 'Short Term Visa';masterObject57.Reference_To__c = '()';masterObject57.Referencing_Value__c = '';fieldMasterList.add( masterObject57);
Field_Master__c masterObject58 = new Field_Master__c();masterObject58.API_Name__c = 'Telephone_EDNRD__c';masterObject58.IsActive__c = true;masterObject58.Name = 'Telephone - EDNRD';masterObject58.Reference_To__c = '()';masterObject58.Referencing_Value__c = '';fieldMasterList.add( masterObject58);
Field_Master__c masterObject59 = new Field_Master__c();masterObject59.API_Name__c = 'Employment__c';masterObject59.IsActive__c = true;masterObject59.Name = 'Employment';masterObject59.Reference_To__c = '()';masterObject59.Referencing_Value__c = '';fieldMasterList.add( masterObject59);
Field_Master__c masterObject60 = new Field_Master__c();masterObject60.API_Name__c = 'Barcode_URL__c';masterObject60.IsActive__c = true;masterObject60.Name = 'Barcode URL';masterObject60.Reference_To__c = '()';masterObject60.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject60);
Field_Master__c masterObject61 = new Field_Master__c();masterObject61.API_Name__c = 'Sponsor_Emirates__c';masterObject61.IsActive__c = true;masterObject61.Name = 'Sponsor Emirates';masterObject61.Reference_To__c = '()';masterObject61.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject61);
Field_Master__c masterObject62 = new Field_Master__c();masterObject62.API_Name__c = 'Emirates_Type__c';masterObject62.IsActive__c = true;masterObject62.Name = 'Emirates Type';masterObject62.Reference_To__c = '()';masterObject62.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject62);
Field_Master__c masterObject63 = new Field_Master__c();masterObject63.API_Name__c = 'Establishment_Name__c';masterObject63.IsActive__c = true;masterObject63.Name = 'Establishment Name';masterObject63.Reference_To__c = '(Account)';masterObject63.Referencing_Value__c = 'Namex';fieldMasterList.add( masterObject63);
Field_Master__c masterObject64 = new Field_Master__c();masterObject64.API_Name__c = 'Mobile_No__c';masterObject64.IsActive__c = true;masterObject64.Name = 'Mobile No';masterObject64.Reference_To__c = '()';masterObject64.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject64);
Field_Master__c masterObject65 = new Field_Master__c();masterObject65.API_Name__c = 'Normal_Passport__c';masterObject65.IsActive__c = true;masterObject65.Name = 'Normal Passport';masterObject65.Reference_To__c = '()';masterObject65.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject65);
Field_Master__c masterObject66 = new Field_Master__c();masterObject66.API_Name__c = 'Area__c';masterObject66.IsActive__c = true;masterObject66.Name = 'Area';masterObject66.Reference_To__c = '()';masterObject66.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject66);
Field_Master__c masterObject67 = new Field_Master__c();masterObject67.API_Name__c = 'Building__c';masterObject67.IsActive__c = true;masterObject67.Name = 'Building';masterObject67.Reference_To__c = '()';masterObject67.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject67);
Field_Master__c masterObject68 = new Field_Master__c();masterObject68.API_Name__c = 'Residency_Tel__c';masterObject68.IsActive__c = true;masterObject68.Name = 'Residency Tel';masterObject68.Reference_To__c = '()';masterObject68.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject68);
Field_Master__c masterObject69 = new Field_Master__c();masterObject69.API_Name__c = 'Office_Tel__c';masterObject69.IsActive__c = true;masterObject69.Name = 'Office Tel';masterObject69.Reference_To__c = '()';masterObject69.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject69);
Field_Master__c masterObject70 = new Field_Master__c();masterObject70.API_Name__c = 'First_Language__c';masterObject70.IsActive__c = true;masterObject70.Name = 'First Language';masterObject70.Reference_To__c = '()';masterObject70.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject70);
Field_Master__c masterObject71 = new Field_Master__c();masterObject71.API_Name__c = 'Establishment_Number__c';masterObject71.IsActive__c = true;masterObject71.Name = 'Establishment Number';masterObject71.Reference_To__c = '()';masterObject71.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject71);
Field_Master__c masterObject72 = new Field_Master__c();masterObject72.API_Name__c = 'Street__c';masterObject72.IsActive__c = true;masterObject72.Name = 'Street';masterObject72.Reference_To__c = '()';masterObject72.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject72);
Field_Master__c masterObject73 = new Field_Master__c();masterObject73.API_Name__c = 'Emirates__c';masterObject73.IsActive__c = true;masterObject73.Name = 'Emirates';masterObject73.Reference_To__c = '()';masterObject73.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject73);
Field_Master__c masterObject74 = new Field_Master__c();masterObject74.API_Name__c = 'P_O_Box__c';masterObject74.IsActive__c = true;masterObject74.Name = 'P.O.Box';masterObject74.Reference_To__c = '()';masterObject74.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject74);
Field_Master__c masterObject75 = new Field_Master__c();masterObject75.API_Name__c = 'City__c';masterObject75.IsActive__c = true;masterObject75.Name = 'City';masterObject75.Reference_To__c = '()';masterObject75.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject75);
Field_Master__c masterObject76 = new Field_Master__c();masterObject76.API_Name__c = 'English__c';masterObject76.IsActive__c = true;masterObject76.Name = 'English';masterObject76.Reference_To__c = '()';masterObject76.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject76);
Field_Master__c masterObject77 = new Field_Master__c();masterObject77.API_Name__c = 'Mother_Full_Name__c';masterObject77.IsActive__c = true;masterObject77.Name = 'Mother Full Name';masterObject77.Reference_To__c = '()';masterObject77.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject77);
Field_Master__c masterObject78 = new Field_Master__c();masterObject78.API_Name__c = 'FVA_Visiting_Country__c';masterObject78.IsActive__c = true;masterObject78.Name = 'FVA Visiting Country';masterObject78.Reference_To__c = '(CountriesList__c)';masterObject78.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject78);
Field_Master__c masterObject79 = new Field_Master__c();masterObject79.API_Name__c = 'DRV_Sponser_First_Name__c';masterObject79.IsActive__c = true;masterObject79.Name = 'DRV Sponser First Name';masterObject79.Reference_To__c = '()';masterObject79.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject79);
Field_Master__c masterObject80 = new Field_Master__c();masterObject80.API_Name__c = 'Name_of_Authorized_Signatory__c';masterObject80.IsActive__c = true;masterObject80.Name = 'Name of Authorized Signatory';masterObject80.Reference_To__c = '()';masterObject80.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject80);
Field_Master__c masterObject81 = new Field_Master__c();masterObject81.API_Name__c = 'Passport_Number__c';masterObject81.IsActive__c = true;masterObject81.Name = 'Passport Number';masterObject81.Reference_To__c = '()';masterObject81.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject81);
Field_Master__c masterObject82 = new Field_Master__c();masterObject82.API_Name__c = 'CreatedById';masterObject82.IsActive__c = true;masterObject82.Name = 'Created By ID';masterObject82.Reference_To__c = '(User)';masterObject82.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject82);
Field_Master__c masterObject83 = new Field_Master__c();masterObject83.API_Name__c = 'Previous_Job_Title_Position__c';masterObject83.IsActive__c = true;masterObject83.Name = 'Previous Job Title/Position';masterObject83.Reference_To__c = '(Occupation__c)';masterObject83.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject83);
Field_Master__c masterObject84 = new Field_Master__c();masterObject84.API_Name__c = 'VRF_Verify1__c';masterObject84.IsActive__c = true;masterObject84.Name = 'VRF Verify1';masterObject84.Reference_To__c = '()';masterObject84.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject84);
Field_Master__c masterObject85 = new Field_Master__c();masterObject85.API_Name__c = 'FVA_Purpose_of_Visit__c';masterObject85.IsActive__c = true;masterObject85.Name = 'FVA Purpose of Visit';masterObject85.Reference_To__c = '()';masterObject85.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject85);
Field_Master__c masterObject86 = new Field_Master__c();masterObject86.API_Name__c = 'Health_Card_Number__c';masterObject86.IsActive__c = true;masterObject86.Name = 'Health Card Number';masterObject86.Reference_To__c = '()';masterObject86.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject86);
Field_Master__c masterObject87 = new Field_Master__c();masterObject87.API_Name__c = 'Visa_Number__c';masterObject87.IsActive__c = true;masterObject87.Name = 'Visa Number';masterObject87.Reference_To__c = '()';masterObject87.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject87);
Field_Master__c masterObject88 = new Field_Master__c();masterObject88.API_Name__c = 'FVA_Duration_of_Visit__c';masterObject88.IsActive__c = true;masterObject88.Name = 'FVA Duration of Visit';masterObject88.Reference_To__c = '()';masterObject88.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject88);
Field_Master__c masterObject89 = new Field_Master__c();masterObject89.API_Name__c = 'DRV_Sponser_Title__c';masterObject89.IsActive__c = true;masterObject89.Name = 'DRV Sponser Title';masterObject89.Reference_To__c = '()';masterObject89.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject89);
Field_Master__c masterObject90 = new Field_Master__c();masterObject90.API_Name__c = 'IsDeleted';masterObject90.IsActive__c = true;masterObject90.Name = 'Deleted';masterObject90.Reference_To__c = '()';masterObject90.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject90);
Field_Master__c masterObject91 = new Field_Master__c();masterObject91.API_Name__c = 'Company_Name__c';masterObject91.IsActive__c = true;masterObject91.Name = 'Company Name';masterObject91.Reference_To__c = '(Account)';masterObject91.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject91);
Field_Master__c masterObject92 = new Field_Master__c();masterObject92.API_Name__c = 'Date_of_Birth__c';masterObject92.IsActive__c = true;masterObject92.Name = 'Date of Birth';masterObject92.Reference_To__c = '()';masterObject92.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject92);
Field_Master__c masterObject93 = new Field_Master__c();masterObject93.API_Name__c = 'SystemModstamp';masterObject93.IsActive__c = true;masterObject93.Name = 'System Modstamp';masterObject93.Reference_To__c = '()';masterObject93.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject93);
Field_Master__c masterObject94 = new Field_Master__c();masterObject94.API_Name__c = 'Currently_Nationality__c';masterObject94.IsActive__c = true;masterObject94.Name = 'Currently Nationality';masterObject94.Reference_To__c = '(Country__c)';masterObject94.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject94);
Field_Master__c masterObject95 = new Field_Master__c();masterObject95.API_Name__c = 'City_of_Birth__c';masterObject95.IsActive__c = true;masterObject95.Name = 'City of Birth';masterObject95.Reference_To__c = '()';masterObject95.Referencing_Value__c = '';fieldMasterList.add( masterObject95);
Field_Master__c masterObject96 = new Field_Master__c();masterObject96.API_Name__c = 'VRF_Last_Date_of_Entry__c';masterObject96.IsActive__c = true;masterObject96.Name = 'VRF Last Date of Entry';masterObject96.Reference_To__c = '()';masterObject96.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject96);
Field_Master__c masterObject97 = new Field_Master__c();masterObject97.API_Name__c = 'DRV_Sponser_Visa_Number_1__c';masterObject97.IsActive__c = true;masterObject97.Name = 'DRV Sponser Visa Number 1';masterObject97.Reference_To__c = '()';masterObject97.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject97);
Field_Master__c masterObject98 = new Field_Master__c();masterObject98.API_Name__c = 'DRV_Sponser_Mobile__c';masterObject98.IsActive__c = true;masterObject98.Name = 'DRV Sponser Mobile';masterObject98.Reference_To__c = '()';masterObject98.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject98);
Field_Master__c masterObject99 = new Field_Master__c();masterObject99.API_Name__c = 'FVA_Expected_Date_of_Arrival__c';masterObject99.IsActive__c = true;masterObject99.Name = 'FVA Expected Date of Arrival';masterObject99.Reference_To__c = '()';masterObject99.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject99);
Field_Master__c masterObject100 = new Field_Master__c();masterObject100.API_Name__c = 'Passport_Issue_Date__c';masterObject100.IsActive__c = true;masterObject100.Name = 'Passport Issue Date';masterObject100.Reference_To__c = '()';masterObject100.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject100);
Field_Master__c masterObject101 = new Field_Master__c();masterObject101.API_Name__c = 'Last_Name__c';masterObject101.IsActive__c = true;masterObject101.Name = 'Last Name';masterObject101.Reference_To__c = '()';masterObject101.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject101);
Field_Master__c masterObject102 = new Field_Master__c();masterObject102.API_Name__c = 'First_Name__c';masterObject102.IsActive__c = true;masterObject102.Name = 'First Name';masterObject102.Reference_To__c = '()';masterObject102.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject102);
Field_Master__c masterObject103 = new Field_Master__c();masterObject103.API_Name__c = 'CreatedDate';masterObject103.IsActive__c = true;masterObject103.Name = 'Created Date';masterObject103.Reference_To__c = '()';masterObject103.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject103);
Field_Master__c masterObject104 = new Field_Master__c();masterObject104.API_Name__c = 'OwnerId';masterObject104.IsActive__c = true;masterObject104.Name = 'Owner ID';masterObject104.Reference_To__c = '"(Group';masterObject104.Referencing_Value__c = ' User)"';fieldMasterList.add( masterObject104);
Field_Master__c masterObject105 = new Field_Master__c();masterObject105.API_Name__c = 'Gender__c';masterObject105.IsActive__c = true;masterObject105.Name = 'Gender';masterObject105.Reference_To__c = '()';masterObject105.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject105);
Field_Master__c masterObject106 = new Field_Master__c();masterObject106.API_Name__c = 'request_type__c';masterObject106.IsActive__c = true;masterObject106.Name = 'request_type';masterObject106.Reference_To__c = '()';masterObject106.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject106);
Field_Master__c masterObject107 = new Field_Master__c();masterObject107.API_Name__c = 'Hold_UAE_Permit__c';masterObject107.IsActive__c = true;masterObject107.Name = 'Hold UAE Permit';masterObject107.Reference_To__c = '()';masterObject107.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject107);
Field_Master__c masterObject108 = new Field_Master__c();masterObject108.API_Name__c = 'DRV_Sponser_Passport_Number__c';masterObject108.IsActive__c = true;masterObject108.Name = 'DRV Sponser Passport Number';masterObject108.Reference_To__c = '()';masterObject108.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject108);
Field_Master__c masterObject109 = new Field_Master__c();masterObject109.API_Name__c = 'Passport_Expiry_Date__c';masterObject109.IsActive__c = true;masterObject109.Name = 'Passport Expiry Date';masterObject109.Reference_To__c = '()';masterObject109.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject109);
Field_Master__c masterObject110 = new Field_Master__c();masterObject110.API_Name__c = 'Country_of_Birth__c';masterObject110.IsActive__c = true;masterObject110.Name = 'Country of Birth';masterObject110.Reference_To__c = '(CountriesList__c)';masterObject110.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject110);
Field_Master__c masterObject111 = new Field_Master__c();masterObject111.API_Name__c = 'LastModifiedById';masterObject111.IsActive__c = true;masterObject111.Name = 'Last Modified By ID';masterObject111.Reference_To__c = '(User)';masterObject111.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject111);
Field_Master__c masterObject112 = new Field_Master__c();masterObject112.API_Name__c = 'DRV_Sponser_Company_Name__c';masterObject112.IsActive__c = true;masterObject112.Name = 'DRV Sponser Company Name';masterObject112.Reference_To__c = '(Account)';masterObject112.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject112);
Field_Master__c masterObject113 = new Field_Master__c();masterObject113.API_Name__c = 'Visa_Issue_Date__c';masterObject113.IsActive__c = true;masterObject113.Name = 'Visa Issue Date';masterObject113.Reference_To__c = '()';masterObject113.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject113);
Field_Master__c masterObject114 = new Field_Master__c();masterObject114.API_Name__c = 'DRV_Sponser_Last_Name__c';masterObject114.IsActive__c = true;masterObject114.Name = 'DRV Sponser Last Name';masterObject114.Reference_To__c = '()';masterObject114.Referencing_Value__c = 'eFormCode__c';fieldMasterList.add( masterObject114);
        
        
        
        
        
        
        
        
        
        
        
       
        
        
        

        if(fieldMasterList.size() > 0)
            insert fieldMasterList;
        
        
        List<Form_Detail__c> formDetailList = new List<Form_Detail__c>();
        
        //Form Detail...
        for(Form_Header__c formHeader : formHeaderList)
        {
            integer counter = 1;
            for(Field_Master__c masterObject : fieldMasterList )
            {
            
            
             If(formHeader.Name == 'Non DIFC Sponsorship Form - Renewal' && ( masterObject.API_Name__c == 'Area__c' ||masterObject.API_Name__c == 'Building__c' ||masterObject.API_Name__c == 'City_of_Birth__c' ||masterObject.API_Name__c == 'City__c' ||masterObject.API_Name__c == 'Country_of_Birth__c' ||masterObject.API_Name__c == 'Currently_Nationality__c' ||masterObject.API_Name__c == 'Date_of_Birth__c' ||masterObject.API_Name__c == 'DRV_Relation_with_Sponser__c' ||masterObject.API_Name__c == 'DRV_Sponser_Currently_Nationality__c' ||masterObject.API_Name__c == 'DRV_Sponser_First_Name__c' ||masterObject.API_Name__c == 'DRV_Sponser_Last_Name__c' ||masterObject.API_Name__c == 'DRV_Sponser_Middle_Name__c' ||masterObject.API_Name__c == 'DRV_Sponser_Mobile__c' ||masterObject.API_Name__c == 'DRV_Sponser_Passport_Expiry__c' ||masterObject.API_Name__c == 'DRV_Sponser_Passport_Number__c' ||masterObject.API_Name__c == 'DRV_Sponser_Residency_Expiry__c' ||masterObject.API_Name__c == 'DRV_Sponser_Visa_Number_2__c' ||masterObject.API_Name__c == 'DRV_Sponser_Visa_Number_3__c' ||masterObject.API_Name__c == 'Emirates__c' ||masterObject.API_Name__c == 'English__c' ||masterObject.API_Name__c == 'First_Name__c' ||masterObject.API_Name__c == 'Gender__c' ||masterObject.API_Name__c == 'Job_Title_Position__c' ||masterObject.API_Name__c == 'Last_Name__c' ||masterObject.API_Name__c == 'Marital_Status__c' ||masterObject.API_Name__c == 'Middle_Name__c' ||masterObject.API_Name__c == 'Mother_Full_Name__c' ||masterObject.API_Name__c == 'Normal_Passport__c' ||masterObject.API_Name__c == 'Office_Tel__c' ||masterObject.API_Name__c == 'Passport_City_of_Issue__c' ||masterObject.API_Name__c == 'Passport_Country_of_Issue__c' ||masterObject.API_Name__c == 'Passport_Expiry_Date__c' ||masterObject.API_Name__c == 'Passport_Issue_Date__c' ||masterObject.API_Name__c == 'Passport_Number__c' ||masterObject.API_Name__c == 'Previous_Nationality__c' ||masterObject.API_Name__c == 'P_O_Box__c' ||masterObject.API_Name__c == 'Religion__c' ||masterObject.API_Name__c == 'Residency_Tel__c' ||masterObject.API_Name__c == 'Sponsor_Department__c' ||masterObject.API_Name__c == 'Sponsor_Gender__c' ||masterObject.API_Name__c == 'Street__c')){
                Form_Detail__c formDetail1 = new Form_Detail__c( Source__c = 'Form' , Position__c = counter , Tab_Space__c = string.valueof(counter) , Form_Header__c = formHeader.Id , Field_Master__c = masterObject.Id);
                if ( masterObject.API_Name__c == 'Sponsor_Department__c' || masterObject.API_Name__c == 'Street__c' || masterObject.API_Name__c == 'City__c' || masterObject.API_Name__c == 'Area__c' || masterObject.API_Name__c == 'Building__c' ||  masterObject.API_Name__c == 'Normal_Passport__c' || masterObject.API_Name__c == 'English__c' || masterObject.API_Name__c == 'Emirates__c' ||  masterObject.API_Name__c == 'Residency_Tel__c' || masterObject.API_Name__c == 'P_O_Box__c' || masterObject.API_Name__c == 'Office_Tel__c' ){
                   formDetail1.Source__c = 'Constant';
                }
                formDetailList.add(formDetail1);
                counter++;                         
             }
            
            
            If( formHeader.Name == 'Non DIFC Sponsorship Form - New - Outside UAE - Visa Stamping' && (masterObject.API_Name__c == 'Area__c' || masterObject.API_Name__c == 'Building__c' || masterObject.API_Name__c == 'City_of_Birth__c' || masterObject.API_Name__c == 'City__c' || masterObject.API_Name__c == 'Country_of_Birth__c' || masterObject.API_Name__c == 'Currently_Nationality__c' || masterObject.API_Name__c == 'Date_of_Birth__c' || masterObject.API_Name__c == 'DRV_Relation_with_Sponser__c' || masterObject.API_Name__c == 'DRV_Sponser_Currently_Nationality__c' || masterObject.API_Name__c == 'DRV_Sponser_First_Name__c' || masterObject.API_Name__c == 'DRV_Sponser_Last_Name__c' || masterObject.API_Name__c == 'DRV_Sponser_Middle_Name__c' || masterObject.API_Name__c == 'DRV_Sponser_Mobile__c' || masterObject.API_Name__c == 'DRV_Sponser_Passport_Expiry__c' || masterObject.API_Name__c == 'DRV_Sponser_Passport_Number__c' || masterObject.API_Name__c == 'DRV_Sponser_Residency_Expiry__c' || masterObject.API_Name__c == 'DRV_Sponser_Visa_Number_2__c' || masterObject.API_Name__c == 'DRV_Sponser_Visa_Number_3__c' || masterObject.API_Name__c == 'Emirates__c' || masterObject.API_Name__c == 'English__c' || masterObject.API_Name__c == 'First_Name__c' || masterObject.API_Name__c == 'Gender__c' || masterObject.API_Name__c == 'Job_Title_Position__c' || masterObject.API_Name__c == 'Last_Name__c' || masterObject.API_Name__c == 'Marital_Status__c' || masterObject.API_Name__c == 'Middle_Name__c' || masterObject.API_Name__c == 'Mother_Full_Name__c' || masterObject.API_Name__c == 'Normal_Passport__c' || masterObject.API_Name__c == 'Office_Tel__c' || masterObject.API_Name__c == 'Passport_City_of_Issue__c' || masterObject.API_Name__c == 'Passport_Country_of_Issue__c' || masterObject.API_Name__c == 'Passport_Expiry_Date__c' || masterObject.API_Name__c == 'Passport_Issue_Date__c' || masterObject.API_Name__c == 'Passport_Number__c' || masterObject.API_Name__c == 'Previous_Nationality__c' || masterObject.API_Name__c == 'P_O_Box__c' || masterObject.API_Name__c == 'Religion__c' || masterObject.API_Name__c == 'Residency_Tel__c' || masterObject.API_Name__c == 'Sponsor_Department__c' || masterObject.API_Name__c == 'Sponsor_Gender__c' || masterObject.API_Name__c == 'Street__c') ){
                Form_Detail__c formDetail1 = new Form_Detail__c( Source__c = 'Form' , Position__c = counter , Tab_Space__c = string.valueof(counter) , Form_Header__c = formHeader.Id , Field_Master__c = masterObject.Id);
                if ( masterObject.API_Name__c == 'Area__c' || masterObject.API_Name__c == 'Building__c' || masterObject.API_Name__c == 'City__c' || masterObject.API_Name__c == 'Emirates__c' || masterObject.API_Name__c == 'English__c' ||  masterObject.API_Name__c == 'Normal_Passport__c' || masterObject.API_Name__c == 'Office_Tel__c' || masterObject.API_Name__c == 'P_O_Box__c' ||  masterObject.API_Name__c == 'Residency_Tel__c' || masterObject.API_Name__c == 'Sponsor_Department__c' || masterObject.API_Name__c == 'Street__c'){
                   formDetail1.Source__c = 'Constant';
                }
                formDetailList.add(formDetail1);
                counter++;
            }
                
          
                
                
                
            }
            
            /*Form_Detail__c formDetail1 = new Form_Detail__c();
            formDetail1.Source__c = 'Constant';
            formDetail1.Form_Header__c = formHeader.Id;
            formDetail1.Tab_Space__c = string.valueof(counter);
            formDetail1.Position__c = counter;
            //Adding in the List...
            formDetailList.add(formDetail1);*/
            
        }
        
        //inserting the form Details...
        if(formDetailList.size() > 0)
            insert formDetailList;
    }
    
}